package com.bestcem.xm.label.grpc.service.param.label;

import com.bestcem.xm.common.core.constant.RegTypes;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import static com.bestcem.xm.label.constant.Constants.LABEL_NAME_MAX_LEN;

/**
 * 标签参数
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/5/21
 */
@Getter
@Setter
public class LabelParamBase {
    /**
     * 组织id
     */
    @NotBlank(message = "机构id不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "机构id格式错误")
    private String orgId;

    /**
     * 联系人类型
     */
    @NotNull(message = "联系人类型不能为空")
    private Integer attribute;

    /**
     * 标签组id
     */
    @NotBlank(message = "标签组id不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "标签组id格式错误")
    private String labelGroupId;

    /**
     * 自动打标签
     */
    @NotNull(message = "自动打标签不能为空")
    private Boolean auto;

    /**
     * 手动打标签
     */
    @NotNull(message = "手动打标签不能为空")
    private Boolean manual;

    /**
     * 标签名称
     */
    @NotBlank(message = "标签名称不能为空")
    @Size(max = LABEL_NAME_MAX_LEN, message = "标签名称长度不能超过30")
    private String name;

}
